*****************************************************************
* Local Partisan Biases in Allocations of Foreign Aid: 
* A Study of Agricultural Assistance in India
*
* Brian Min, Eugenio Arima, David Backer, Allen Hicken, Ken Kollman, and Joel Selway 
* World Politics, 2023 no. 1
*
*
* CONSTITUENCY-LEVEL SPATIAL ANALYSIS
* Replication code for: 
* Table 6
*
* Rev 7 July 2022
*****************************************************************


*******************************************
* TABLE 6 
* Spatial Models of Agricultural Aid Allocation (Constituency-Level)

	
set more off
clear all

use "AC_India_AgAid_ts_balanced_nomiss_20190730_v15_W.dta",clear

* Use W05 contiguity matrix
spmatrix use W05 using w05.stswm, replace
* Hard code year dummies
tabulate year, gen(yeard)

	

* Model 1 SEM
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_align_both yeard*,  errorlag(W05) fe

* Model 2 SEM
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov ///
	l_align_st l_align_ce l_align_both yeard*, errorlag(W05) fe

* Model 3 SEM
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov ///
	l_align_st l_align_ce l_align_both l_bjp l_cp l_othp yeard*, errorlag(W05) fe

* Model 4 GNS
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_align_both yeard*,  dvarlag(W05) errorlag(W05) ivarlag(W05:  l_c3_pct l_c4_pct l_SPI12m l_align_both) fe

* Model 5 GNS
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov ///
	l_align_st l_align_ce i.l_align_both yeard*,  ///
	dvarlag(W05) errorlag(W05) ivarlag(W05:  l_c3_pct l_c4_pct l_SPI12m l_electionyear ///
	l_turnout l_mov l_align_st l_align_ce i.l_align_both) fe
	
* Model 6 GNS
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov ///
	l_align_st l_align_ce l_align_both  l_bjp l_cp l_othp yeard*,  ///
	dvarlag(W05) errorlag(W05) ivarlag(W05:  l_c3_pct l_c4_pct l_SPI12m l_electionyear ///
	l_turnout l_mov l_align_st l_align_ce l_align_both  l_bjp l_cp l_othp ) fe

* Model 7 Non-Spatial
	xtreg project_start l_c3_pct l_c4_pct l_SPI12m i.l_align_both i.year, fe

* Model 8 Non-Spatial
	xtreg project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov i.l_align_st i.l_align_ce i.l_align_both i.year, fe
		
* Model 9 Non-Spatial
	xtreg project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov i.l_align_st i.l_align_ce i.l_align_both l_bjp l_cp l_othp i.year, fe

		



	
	
